package com.ruoyi.Order.service.impl;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.Order.mapper.OrderMapper;
import com.ruoyi.Order.domain.Order;
import com.ruoyi.Order.service.IOrderService;
import com.ruoyi.common.core.text.Convert;

/**
 * 订单 服务层实现
 * 
 * @author ruoyi
 * @date 2019-07-23
 */
@Service
public class OrderServiceImpl implements IOrderService 
{
	@Autowired
	private OrderMapper orderMapper;

	/**
     * 查询订单信息
     * 
     * @param id 订单ID
     * @return 订单信息
     */
    @Override
	public Order selectOrderById(Integer id)
	{
	    return orderMapper.selectOrderById(id);
	}
	
	/**
     * 查询订单列表
     * 
     * @param order 订单信息
     * @return 订单集合
     */
	@Override
	public List<Order> selectOrderList(Order order)
	{
	    return orderMapper.selectOrderList(order);
	}
	
    /**
     * 新增订单
     * 
     * @param order 订单信息
     * @return 结果
     */
	@Override
	public int insertOrder(Order order)
	{
	    return orderMapper.insertOrder(order);
	}
	
	/**
     * 修改订单
     * 
     * @param order 订单信息
     * @return 结果
     */
	@Override
	public int updateOrder(Order order)
	{
	    return orderMapper.updateOrder(order);
	}

	/**
     * 删除订单对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteOrderByIds(String ids)
	{
		return orderMapper.deleteOrderByIds(Convert.toStrArray(ids));
	}

	@Override
	public List<Order> selectOrderGoodsList(Integer id) {
		// TODO Auto-generated method stub
		return orderMapper.selectOrderGoodsList(id);
	}
	
	@Override
	public int selectCountOnThisDay(String days,int schoolId) {
		// TODO Auto-generated method stub
		return orderMapper.selectCountOnThisDay(days,schoolId);
	}

	@Override
	public int selectCountOnThisDayForTUIKUAN(String days,int schoolId) {
		// TODO Auto-generated method stub
		return orderMapper.selectCountOnThisDayForTUIKUAN(days,schoolId);
	}

	@Override
	public int selectCountOnThisMonth(String month,int schoolId) {
		return orderMapper.selectCountOnThisMonth(month,schoolId);
	}

	@Override
	public int selectCountOnThisMonthForTUIKUAN(String month,int schoolId) {
		return orderMapper.selectCountOnThisMonthForTUIKUAN(month,schoolId);
	}

	@Override
	public int selectCountOnThisYear(String year,int schoolId) {
		return orderMapper.selectCountOnThisYear(year,schoolId);
	}

	@Override
	public int selectCountOnThisYearForTUIKUAN(String year,int schoolId) {
		return orderMapper.selectCountOnThisYearForTUIKUAN(year,schoolId);
	}

	@Override
	public int selectCountAll(int schoolId) {
		return orderMapper.selectCountAll(schoolId);
	}
	
	@Override
	public int selectVerifyOrderCount(String deptId) {
		return orderMapper.selectVerifyOrderCount(deptId);
	}

	

	@Override
	public List<Map<String, Object>> selectCountForInformationYear(
			int schoolId, String year,int flag) {
		return orderMapper.selectCountForInformationYear(schoolId,year,flag);
	}

	@Override
	public List<Map<String, Object>> selectCountForInformationMonth(
			int schoolId, String createDate, int flag) {
		return orderMapper.selectCountForInformationMonth(schoolId,createDate,flag);
	}

	@Override
	public List<Map<String, Object>> selectMoneyForInformationMonth(
			int schoolId, String createDate) {
		return orderMapper.selectMoneyForInformationMonth(schoolId,createDate);
	}

	@Override
	public List<Map<String, Object>> selectMoneyForInformationYear(
			int schoolId, String year) {
		return orderMapper.selectMoneyForInformationYear(schoolId,year);
	}

	@Override
	public List<Map<String, Object>> selectCountForStoreYear(String deptId,
			String year, int flag) {
		return orderMapper.selectCountForStoreYear(deptId,year,flag);
	}

	@Override
	public List<Map<String,Object>> selectMoneyEveryday(@Param("schoolId") String deptId) {
		return orderMapper.selectMoneyEveryday(deptId);
	};
	
}
